<!DOCTYPE html>
<html>
<head>
<title>省市县区域</title>
<#include "/header.html">
</head>
<body>
<div id="witapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
            <div class="form-group col-sm-2">
                <input type="text" class="form-control" id="name" @keyup.enter="query" placeholder="关键字查询">
            </div>
            <a class="btn btn-default" @click="query">查询</a>
			<#if shiro.hasPermission("sysarea:save")>
            <a class="btn btn-success" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("sysarea:update")>
            <a class="btn btn-success" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("sysarea:delete")>
            <a class="btn btn-success" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>
    
    <div v-show="!showList" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
			<div class="form-group">
			   	<div class="col-sm-2 control-label">区域名称</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="sysArea.name" placeholder="区域名称"/>
			    </div>
			</div>
            <div class="form-group">
                <div class="col-sm-2 control-label" title="父级名称,默认是省级">父级名称</div>
                <div class="col-sm-10">
                    <input type="text" title="选择父级名称,默认是省级" class="form-control" readonly="readonly" id="parentName" onclick="thisPage.showAreaTree()" v-model="sysArea.pName" placeholder="父级名称,默认是省级"/>
                    <input type="hidden" id="parentValue" v-model="sysArea.pid"/>
                </div>
            </div>
		    <div class="form-group">
			   	<div class="col-sm-2 control-label" title="区域级别(1省;2市;3县;4镇;5村)">区域级别</div>
			   	<div class="col-sm-10">
                    <select id="level" title="区域级别(1省;2市;3县;4镇;5村)" class="col-sm-12">
                        <option value="0">选择级别</option>
                        <option value="1">省</option>
                        <option value="2">市</option>
                        <option value="3">县</option>
                        <option value="4">镇</option>
                        <option value="5">村</option>
                    </select>
			    </div>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input type="button" class="btn btn-success" @click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
	</div>
</div>
<!-- 代理区域 -->
<div id="proxyAreaLayer" style="display: none;padding:6px;">
    <ul id="proxyAreaTree" class="ztree">
        <li style="margin-top:2px;"><span>获取数据失败</span></li>
    </ul>
</div>
<script src="${request.contextPath}/statics/js/modules/sys/sysarea.js?_${.now?long}"></script>
</body>
</html>